/* D:\ICADDEV\PRJ\ICAD\MTEXTPROPSHEET.H
 * Copyright (C) 1997-1999 DIMINE Co.LTD. All rights reserved.
 *
 * $Revision: 1.1.1.1 $ $Date: 2010/03/03 02:57:12 $
 *
 * Abstract
 *
 * <TODO : Add Abstract here>
 *
 */

#if !defined(AFX_MTEXTPROPSHEET_H__72621C93_0E07_11D3_BE92_00C04F990354__INCLUDED_)
#define AFX_MTEXTPROPSHEET_H__72621C93_0E07_11D3_BE92_00C04F990354__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// MTextPropSheet.h : header file


#include "MTextTextTab.h"
#include "MTextPropertiesTab.h"
#include "MTextRichEdit.h"
#include "BCGPPropertySheet.h"

void ConvertTextHeightToTwips(DM_REAL realHeight, long& twipsHeight);
void ConvertTwipsToTextHeight(DM_REAL& realHeight, long twipsHeight);
/////////////////////////////////////////////////////////////////////////////
// MTextPropSheet

struct  DM_MTextData
{
	dmDPoint		ptInsertion,			    //	Insertion point for block of text
		ptOppCorner;			    //	Opposite corner point for block of text
	DM_REAL			rTextHeight,    		    //	Text Height		(*** I set the default as 1.0, but I don't know what it is supposed to be.  ***)
		rRotAngle  ,	    	    //	Rotation angle for block of text
		rBoxWidth  ;
	char			szTextStyle[2049];    //	Text Style (default is STANDARD?)
	int				nAlignment,
		nDirection;
	CString			text;
};


class MTextPropSheet : public CBCGPPropertySheet//IcadPropertySheet
{
	DECLARE_DYNAMIC(MTextPropSheet)

// Construction
public:
	MTextPropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	MTextPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	MTextPropSheet(UINT nIDCaption, DM_MTextData* dataPtr, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);

	int initialize(DM_MTextData* pData);
	BOOL needCreation();
// Attributes
public:
	MTextTextTab		m_textTab;
	MTextPropertiesTab	m_propertiesTab;
	MTextRichEdit		m_edit;
	CString				m_text;
	double				m_width;
	double				m_height;
	CString				m_fsize;
	DM_MTextData*		m_pMTextData;
	//CButton	m_help;
// Operations
	///Fix by Qin
	double m_FontTrueSize;
public:
	void UpdateChar();
	void FormatText();


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(MTextPropSheet)
	public:
	virtual BOOL OnInitDialog();
	virtual BOOL DestroyWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~MTextPropSheet();

	// Generated message map functions
protected:
	//{{AFX_MSG(MTextPropSheet)
	afx_msg void OnHelp();
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};





/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MTEXTPROPSHEET_H__72621C93_0E07_11D3_BE92_00C04F990354__INCLUDED_)

